package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.pojo.LogQueryParam;
import org.example.pojo.OperateLog;
import org.example.pojo.PageResult;
import org.example.pojo.Result;
import org.example.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired // 添加 Autowired 注解进行依赖注入
    private LogService logService;

    @GetMapping("/page")
    public Result page(LogQueryParam logQueryParam){
        log.info("日志分页查询{}",logQueryParam);
        PageResult<OperateLog> pageResult=logService.page(logQueryParam);
        return Result.success(pageResult);
    }
}